<?php
	/**
	* Cart view - For shopping cart on top only
	* @author trungdt
	* @since Oct 18, 2011
	* 
	* Change logs
	* 
	*/

	if (!defined('EXPONENT')) exit('');
	
	if (!defined("ABProductsModule_Carts"))
		define("ABProductsModule_Carts","ABShopCart_SessionKey");
	
	$carts=exponent_sessions_get(ABProductsModule_Carts);
	if ($carts == null)
		$carts = array();
    
    $cart_count=0;
    foreach ($carts as $v)
        $cart_count+=$v->quantity;
    
	$template=new template("productsmodule","_cart_on_top");
	$template->assign("carts", $carts);
	$template->assign("carts_count", $cart_count);
	$template->output();
?>
